package cn.edu.scau.cmi.linhuanrui.adapter;

import java.util.List;
import java.util.ArrayList;

public class AdapterOfClass extends SortUtil implements Target {
	public void sortStudent(List<Student> student) {
		List<Integer> intList = new ArrayList<>();
		for (Student s : student) {
			intList.add(s.getID());
		}
		sortInt(intList);
		for (int i = 0; i < student.size(); i++) {
			for (int j = 0; j < intList.size(); j++) {
				if (student.get(i).getID() == intList.get(j)) {
					Student temp = student.get(j);
					student.set(j, student.get(i));
					student.set(i, temp);
				}
			}
		}
	}
}
